<?php
/**
 * 业主后台controll基类
 * @author Administrator
 *
 */
class CControllerOwnerLoginBase extends CControllerOwnerBase{
	
	protected $_title = "";
	
	
	
	function __construct($controller, $action){
		parent::__construct($controller, $action);
		
		$this->checkLogin();
		
		$this->getOwnerInfo();
	}
	
	/**
	 * 验证登录
	 */
	private function checkLogin()
	{
		if(!$this->isLogin())
		{
			if($this->getRequestData("isAjax") || $this->getRequestData("isAjax","get"))
			{
				echo -1000;exit;
			}
			$this->redirectUrl("/");
		}
	}
	
	/**
	 * 记录操作日志
	 */
	private function sysLog()
	{
		/* $stmtLog = new syslogModel();
        $get=json_encode($_GET);
        $post=json_encode($_POST);
        $desc="GET:".$get.",POST:".$post;
        $stmtLog->insert(array(
        	"create_user"=>$this->_userName,
        	"description"=>$desc,
        	"create_time"=>date('Y-m-d H:i:s'),
        	"ip"=>CCommon::getClientIP(),
        	'module_identity'=>$this->_controller,
        	'right_name'=>$this->_action),false
        ); */
	}
	
	
	public function render($viewFile,$param=array(),$masterView="owner/common/master")
	{
		$balance = $this->_ownerInfo["balance"];
		$oInfo["balance"] = sprintf("%01.2f",$balance);
		
		parent::render("owner/".$viewFile,$param,$masterView);
	}

}